#include <main.h>

uchar chuan_tab[1];
uint pwm_dly=0,high=300;
uint s;
uint chaog_dly;


void main()
{
	UartInit();
	Timer1Init();
	Timer0Init();
	EA=1;
	while(1)
	{
		mian_chuan();
		if(P22==0)
		{
//			chuan_tab[0]='1';
			P24=1;
			P25=0;
		}
		P24=0;
			P25=0;
//		main_chaog_put();
		printf("s=%d\r\n",(uint)s);
//		printf("high=%d\r\n",(uint)high);
	}
}

void time1() interrupt 3
{
	if(++pwm_dly==1000)pwm_dly=1;
	if(++chaog_dly==200)chaog_dly=1;
	
	if(pwm_dly<high){left_up_pwm=1;left_low_pwm=1;right_up_pwm=1;right_low_pwm=1;}
	else{left_up_pwm=0;left_low_pwm=0;right_up_pwm=0;right_low_pwm=0;}
	 
}
void time4() interrupt 4
{
	if(RI)
	{
		chuan_tab[0]=SBUF;
		RI=0;
	}
	
	
}